﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ECRMS.WinForm.BaseClass;
using ECRMS.WinForm.BaseClass.Common;
using ECRMS.WinForm.Properties;
using ECRMS.WinForm.WinService;
using ECRMS.WinForm.ModuleEdits;
using System.Linq;
using DevExpress.XtraTab;
using DevExpress.XtraRichEdit;
using ECRMS.WinForm.Modules.ReportPrintControl;
using DevExpress.XtraPrinting.Control;

namespace ECRMS.WinForm.Modules.ReportPrintControl
{
    public partial class PrintDetailControl : DevExpress.XtraEditors.XtraUserControl
    {
        //public Core core = Core.getInstance();

        public PrintDetailControl()
        {
            InitializeComponent();
            //InitData();
        }

        //private void InitData()
        //{
        //    FuncResult result = core.CoreReportOfDesign.GetReports(core.CoreUser.UserInfo.CorporationRefId);
        //    if (result.Status == 0)
        //    {
        //        XtraMessageBox.Show(this, Language_ch.ResourceManager.GetString(result.Message));
        //        return;
        //    }

        //        StringBuilder str = new StringBuilder();
        //    foreach (CtReport item in core.CoreReportOfDesign.Reports)
        //    {
        //        str.Append(item.Content != null ? System.Text.Encoding.UTF8.GetString(item.Content.ToArray()) : "");
                
        //    }
        //    recEdit.Controls[0].Text = str.ToString();
        //}

        public PrintControl PrintControl
        {
            get
            {
                PrintControl pc = recEdit.Controls[0] as PrintControl;
                if (pc != null)
                    return pc;
                return null;
            }
        }
    }
}
